<!DOCTYPE html>
<html>
<head>
<title>欢迎注册</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Internship Sign In & Sign Up Form Responsive Widget,Login form widgets, Sign up Web forms , Login signup Responsive web form,Flat Pricing table,Flat Drop downs,Registration Forms,News letter Forms,Elements" />
<script type="application/x-javascript">
addEventListener("load", function() {
	setTimeout(hideURLbar, 0);
}, false);

function hideURLbar() {
	window.scrollTo(0, 1);
}</script>
<!-- Custom Theme files -->
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" media="all">
<link href="css/snow.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- //Custom Theme files -->
<!-- web font -->
<!--<link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
-->
<!-- //web font -->
</head>
<body>
<div class="snow-container">
	<div class="snow foreground"></div>
	<div class="snow foreground layered"></div>
	<div class="snow middleground"></div>
	<div class="snow middleground layered"></div>
	<div class="snow background"></div>
	<div class="snow background layered"></div>
</div>

<div class="top-buttons-agileinfo">
<a href="signin.html">登录</a><a href="signup.html" class="active">注册</a>
</div>
<h1>MobileGroup</h1>
<div class="main-agileits">
		<div class="form-w3-agile">
			<h2 class="sub-agileits-w3layouts">注册</h2>
					<input type="text" name="account" placeholder="账户" required="" />
					<input type="password" name="password" placeholder="密码" required="" />
					<input type="password" name="password1" placeholder="确认密码" required="" />
					<input type="text" name="mobile" placeholder="联系电话" required="" />
					<div class="submit-w3l">
					<input type="submit" value="注册" id="submitBtn">
				</div>
		</div>
		</div>

	<div class="copyright w3-agile">
		<p> © 2017-2018</p>
	</div>

<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="js/layer/layer.js"></script>
<script type="text/javascript" src="js/base.js"></script>
<script type="text/javascript">
$("#submitBtn").click(function() {
	var account = $("[name=account]").val();
	var password = $("[name=password]").val();
	var password1 = $("[name=password1]").val();
	var mobile = $("[name=mobile]").val();
	if(account == ""){
		layer.msg("账号不能为空", {icon: 0});
		return;
	}
	if(password == "" || password1 == ""){
		layer.msg("密码不能为空", {icon: 0});
		return;
	}
	if(password != password1){
		layer.msg("两次密码不一致", {icon: 0});
		return;
	}
	var temp =/^1[3|4|5|7|8|9][0-9]{9}$/;
	if(!temp.test(mobile)){
		layer.msg("手机号码格式有误", {icon: 0});
		return;
	}
	$.ajax({
		type: "POST",
		url: $.httpRootPath()+"/api/web/manager/register",
		dataType: "json",
		data: {
			account: account,
			password: password,
			mobile: mobile
		},
		success: function(reply) {
			if(reply.code == "00") {
				layer.msg(reply.msg, {icon: 1});
			} else {
				layer.msg(reply.msg, {icon: 0});
			}
		}
	})

});
</script>
</body>
</html>